package file;

import java.io.File;

public class FileDemo {
    public static void main(String[] args) {
        //File file=new File("./demo.txt");
        //File file=new File("D:\\JavaProject\\jsd2407\\demo.txt");
        //File file=new File("D:/JavaProject/jsd2407/demo.txt");
        File file = new File("demo.txt");
        System.out.println("文件名:" + file.getName());
        System.out.println("文件大小:" + file.length());
        System.out.println("文件是否可读" + file.canRead());
        System.out.println("文件是否可写:" + file.canWrite());
        System.out.println("文件是否隐藏:" + file.isHidden());
    }
}
